#ifndef WIDGET_H
#define WIDGET_H

#include <QtGui/QWidget>
#include<QtGui/QPushButton>
#include<QtGui/QLabel>
#include<QtGui/QLineEdit>
#include<QtGui/QHBoxLayout>
#include<QtGui/QVBoxLayout>
#include<QtGui/QGridLayout>
#include<QtGui/QRadioButton>
#include<QTextCodec>
#include<QString>
#include<cstring>
#include<QDebug>
#include<math.h>

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = 0);
    ~Widget();
    QPushButton *but1;
    QPushButton *but2;
    QPushButton *but3;
    QPushButton *but4;
    QPushButton *but5;
    QPushButton *but6;
    QPushButton *but7;
    QPushButton *but8;
    QPushButton *but9;
    QPushButton *but0;
    QPushButton *butdian;
    QPushButton *butjia;
    QPushButton *butjian;
    QPushButton *butcheng;
    QPushButton *butchu;
    QPushButton *butdeng;
    QPushButton *butCE;
    QPushButton *butC1;
    QPushButton *butbackspace;
    QPushButton *butfu;
    QPushButton *butgen;
    QPushButton *butbaifen;
    QPushButton *butfen;
    QPushButton *butA;
    QPushButton *butB;
    QPushButton *butC;
    QPushButton *butD;
    QPushButton *butE;
    QPushButton *butF;
    QLineEdit *lineEdit;
    QRadioButton *radio8;
    QRadioButton *radio2;
    QRadioButton *radio16;
    QRadioButton *radio10;
    void clearline();
    int panduan(QString );

    int tentotwo(int );
    int twototen(int );
    int tentoeight(int );
    int eighttoten(int );
    int sixteentoten(QString );
    QString tentosixteen(int );
    int savejinzhi;


private slots:
    void but_1();
    void but_2();
    void but_3();
    void but_4();
    void but_5();
    void but_6();
    void but_7();
    void but_8();
    void but_9();
    void but_0();
    void but_A();
    void but_B();
    void but_C();
    void but_D();
    void but_E();
    void but_F();
    void but_jia();
    void but_jian();
    void but_cheng();
    void but_chu();
    void but_dian();
    void but_CE();
    void but_gen();
    void but_baifen();
    void but_fen();
    void but_deng();
    void but_C1();
    void but_fu();
    void but_backspace();

    void return2_but();
    void return8_but();
    void return10_but();
    void return16_but();

private:
    QString Q1,Q2,Q3;
    char c;
    bool clear;
    int z;
    char ct;
};

#endif // WIDGET_H
